package com.java.base.exercise.jvm;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.TimeUnit;

/**
 * @Author RenPu
 * @Date 2024/2/22 11:03
 * @Version 1.0
 * @Description:
 **/
public class OOMTest {

    private boolean isTrue=false;

    //-Xms10M -Xmx10M -XX:+PrintGCDetails -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=D:\jvm.dump


    public static void main(String[] args) throws InterruptedException {

        List<Object> list =new ArrayList<>();

        for (int i = 0; i <1000 ; i++) {
            list.add(new User(UUID.randomUUID().toString()));
            TimeUnit.SECONDS.sleep(2);

        }

    }



}
